
<title>投资列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(path)/assets/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script> 
<style> 
	body{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"宋体";}
	li{list-style-type:none;}
</style> 
<body bgcolor="#f4f5f9" style="margin:0px;">
	<script id="demo" type="text/x-jquery-tmpl">
		<div align="center" pass="${id}" class="pass"  style="clear:both;height:110px;background:#FFF;width:100%;margin-top:5px;">
			<div style="width:1%;height:110px;float:left;background:${color1}"></div> 
			<div style="width:99%;float:left"> 
				<div style="margin-left:4%;height:30px;line-height:30px;">                        <!--这里-->
					<div style="float:left;">
						<span style="white-space:nowrap;text-overflow:ellipsis;overflow:hidden;float:left">${name}</span>  
						<span ${hid2} style="margin-left:5px;padding:3px 8px 3px 8px;font-size:12px;border-radius:5px;border:1px solid ${color1};color:${color1}">
						${hid2info}
						</span>
						<img ${hid8} style="width:12px;margin-left:5px;margin-top:10px;" src="#(assets)/images/mobile/index_closed.png">
					</div>
					<img ${hid3} style="float:right;height:30px;" src="/assets/images/mobile/investList_huan.png">
					<img ${hid4} style="float:right;height:30px;" src="/assets/images/mobile/investList_dai.png">
					<img ${hid5} style="float:right;height:30px;" src="/assets/images/mobile/investList_wan.png">
					<img ${hid6} style="float:right;height:30px;" src="/assets/images/mobile/investList_wei.png">
					<img ${hid7} style="float:right;height:30px;" src="/assets/images/mobile/investList_man.png"> 
				</div>
				<div style="clear:both;width:96%;border-top:1px solid #f4f4f4;height:60px;">
					<div style="width:35%;float:left;">
					<!--这里-->
						<div style="height:40px;line-height:40px;">
							<span style="font-size:18px;color:${color1};height:60px;">${rate}%</span>
							<span ${hid} style="font-size:12px;color:${color1}">+${plus_rate}%</span>
						</div>
						<div style="font-size:14px;color:#8f8f8f;height:20px;line-height:20px;">预期年化</div>
					</div>
					<div style="width:20%;float:left;">
						<div style="height:40px;line-height:40px;">
							<span style="font-size:26px;color:#383838">${day_limit}</span>
							<span style="color:#8f8f8f;font-size:14px;">天</span>
						</div>
						<div style="font-size:14px;color:#8f8f8f;height:20px;line-height:20px;">期限</div>
					</div>
					<div style="width:45%;float:left;">         <!--这里--> 
						<div style="height:40px;line-height:40px;">
							<span style="font-size:13px;color:#8f8f8f">${unit_amount}</span>
						</div>
						<div style="float:left;width:58%;height:20px;overflow:hidden;position:relative;margin-left:5%;">
							<div style="position:relative;float:left;margin-top:9px;height:2px;width:100%;background:${color1}">
								<div id="jindu${id}" style="position:relative;float:left;height:2px;width:100%;background:#eee"></div>
							</div>
						</div>
						<div style="height:20px;line-height:20px;float:right;font-size:12px;color:#8f8f8f">${jindu}%</div>
					</div>
				</div>
			</div>
		</div> 
	</script>
	<div id="alllist" align="center" style="padding-bottom:60px;"></div>
	<div id="showlists"></div>	
	<div align="center" style="clear:both;position:fixed;bottom:0px;height:57px;width:100%;border-top:1px solid #d2d2d2;background:#FFF;z-index:2000">
		<div style="color:#8a8a8a;float:left;width:33.3%;height:50px;padding-bottom:5px" onclick="window.location.href='/app/page/index-index'">
			<img style="height:25px;margin-top:5px;" src="/assets/images/mobile/menu_11.png">
			<div style="font-size:12px;margin-top:5px;">推荐</div>
		</div>
		<div style="color:#fa3048;float:left;width:33.3%;height:50px;border-bottom:2px solid #fa3048;padding-bottom:5px" onclick="window.location.href='/app/page/invest-investList'">
			<img style="height:25px;margin-top:5px;" src="/assets/images/mobile/menu_22.png">
			<div style="font-size:12px;margin-top:5px;">投资</div>
		</div>
		<div style="color:#8a8a8a;float:left;width:33.3%;height:50px;padding-bottom:5px" onclick="window.location.href='/app/page/personal-personal'">
			<img style="height:25px;margin-top:5px;" src="/assets/images/mobile/menu_31.png">
			<div style="font-size:12px;margin-top:5px;">我的</div>
		</div> 
	</div>
	<!--蒙版输入密码-->
	<div id="extract_mengban"  hidden style="background-color:rgba(0,0,0,0.4);position:fixed;top:0;width:100%;height:100%;z-index:550"><div>
	<div align="center" hidden  id="extract_tishi" style="margin-left:5%;background:#FFF;position:fixed;top:100px;height:140px;width:90%;z-index:600;border-radius:10px;font-size:14px;">
		<div align="center" style="width:100%;line-height:49px;height:49px;border-bottom:1px solid #eee;font-size:16px;"> 
			<a style="color:#626262">请输入投资密码</a>
		</div>
		<div style="width:100%;line-height:40px;height:40px;">
			<input placeholder="投资密码" id="mima" style="font-size:16px;height:30px;margin-top:5px;"   />
		</div>
		
		<div align="center" style="clear:both;width:100%;line-height:49px;height:49px;border-top:1px solid #e6e6e6">
			<div id="extract_true" align="center" style="float:left;width:49%;height:49px;border-right:1px solid #e6e6e6">确认</div>
			<div id="extract_false" align="center" style="float:right;width:49%;height:49px">取消</div>
		</div>
	</div>
	
	<!--菜单-->
	<script type="text/javascript" src="/assets/dropload/dropload.min.js"></script>
	<link rel="stylesheet" href="/assets/dropload/dropload.css">
	<script>
    var page = 0;
	$('#alllist').dropload({
		scrollArea : window,
		loadDownFn : function(me){
			page++; 
			var url = "/bid/list?size=10&status=trading*finish*waiting*repaying&page="+page;
			console.log(page);
			$.getJSON(url, function(tzlist) {
				console.log(tzlist);
				$.each(tzlist.data.page.list, function(i, item){ 
					var color1 = "#8f8f8f";
					var hid2 = "hidden";
					var hid3 = "hidden";
					var hid4 = "hidden";
					var hid5 = "hidden";
					var hid6 = "hidden"; 
					var hid7 = "hidden";
					var hid8 = "hidden";
					var jindu = (Number(item.avunit) * Number(item.unit_amount)*100/ Number(item.amount)).toFixed(2);
					if(item.plus_rate == "0.0"){
						var hid = "hidden";
					}
					if(item.type == "experi"){
						var unit_amount = "单笔投资仅限一张";
					}else{
						var unit_amount = "一份起购("+item.unit_amount+"元)递增";
					}
					if(item.status == "trading"){
						if(jindu==100){
							hid7 = "";
						}
						if(item.type == "experi"){
							var color1="#ff7b16"
						}else{
							var color1 = "#3ec9b4";
						}
					}
					if(item.is_direct==1){
						hid8= "";
					}
					if(item.status == "finish"){
						hid5 = "";
					}
					if(item.status == "repaying"){
						hid4 = "";
					}
					if(item.status == "waiting"){
						hid6 = "";
					}
					if(item.type =="first"){
						var hid2 = "";
						var hid2info = "仅限一次";
					}else if(item.type =="experi"){
						var hid2 = "";
						var hid2info = "体验金可用"; 
					}
					
					var invests = {hid8:hid8,hid7:hid7,hid6:hid6,hid5:hid5,hid4:hid4,hid3:hid3,hid2info:hid2info,hid2:hid2,color1:color1,id:item.id,jindu:jindu,unit_amount:unit_amount,day_limit:item.day_limit,hid:hid,name:item.name,rate:item.rate,plus_rate:item.plus_rate};
					$("#demo").tmpl(invests).appendTo('#alllist');
					$("#jindu"+item.id).animate({left:jindu+'%'},1000);
				});

				$(".pass").unbind().click(function(){
					$("#mima").val("");
					var that = $(this);
					var idval = that.attr("pass");
					console.log(idval);
					$.getJSON("/bid/info?token=#(session.token??)&id="+idval, function(data) {
						console.log(data);
						var datainfo = data.data.item;
						if(datainfo.is_direct==1){
							$("#extract_mengban").show();
							$("#extract_tishi").show();
							
							$("#extract_false").click(function(){
								$("#extract_mengban").hide();
								$("#extract_tishi").hide();
							});
							$("#extract_true").click(function(){
								if($("#mima").val()==datainfo.password){
									if(datainfo.type=="experi"){
										window.location.href='/app/page/invest-tastedetail?id='+idval;
									}else{
										window.location.href='/app/page/invest-investDetail?id='+idval;
									}
								}else{
									alert("输入密码错误，请重新输入！");
								}
							});
						}else{
							if(datainfo.type=="experi"){
								window.location.href='/app/page/invest-tastedetail?id='+idval;
							}else{
								window.location.href='/app/page/invest-investDetail?id='+idval;
							}
						}
					});
				});
				$(".dropload-down").css("height","0px"); 
				if(!tzlist.data.page.lastPage){
					me.resetload();	
				}
			});
		}
	});			
	</script> 
	
</body>